package easy.id_101_200;

import easy.pojo.TreeNode;

import java.util.ArrayList;
import java.util.LinkedList;
import java.util.List;

public class Lee112 {
    public static void main(String[] args) {

    }

    public boolean hasPathSum(TreeNode root, int targetSum) {
        if(root==null) return false;
        if(root.val==targetSum && root.left==null && root.right==null) return true;

        return hasPathSum(root.left,targetSum- root.val) || hasPathSum(root.right,targetSum- root.val);
    }

}
